<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CommonAlbumContent.ascx.cs" Inherits="admin_webparts_Plug_ins_CommonPage_CommonAlbumContent" %>
<%@ Import Namespace="NTTHAO.Web.BL.CommonPage" %>
<%@ Import Namespace="NTTHAO.Common.BL" %>
<%@ Import Namespace="NTTHAO.CommonWeb" %>
<style type="text/css">
    #spLinkAdd, #spLinkEdit, #spLinkDelete, #spLinkAddContent, #spLinkAddAlbum {font-size:1.1em; font-weight: bold; }
    #spLinkAdd button, #spLinkEdit button, #spLinkDelete button, #spLinkAddContent button, #spLinkAddAlbum button { font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold; }
</style>
<div class="tip" style="height: 22px;">
    <div style=" width: 200px; clear: left; float: left;">
        <h2 style="padding-top: 2px;"><%=LanguageUtility.GetLanguageText("COMMON_ALBUM_DETAIL", Session)%></h2>
    </div>
    <div style="display: block; height: 32px; float: right; position: relative; top: -5px; text-align: right;">
        <%if (this._Album != null) { %>
        <span id="spLinkEdit" class="yui-button yui-link-button yuibtn yuibtn-icon btnedit" style="margin-bottom: 5px;"><span class="first-child"><a href="?action=editalbum&g=<%=this.Request.QueryString["g"] %>&mnuid=<%=this.Request.QueryString["mnuid"] %>&id=<%=this._Album.ID %>"><%=LanguageUtility.GetLanguageText("EDIT", Session)%></a></span></span>
        <span id="spLinkDelete" class="yui-button yui-link-button yuibtn yuibtn-icon btndelete" style="margin-bottom: 5px;"><span class="first-child"><a href="?action=delalbum&g=<%=this.Request.QueryString["g"] %>&mnuid=<%=this.Request.QueryString["mnuid"] %>&id=<%=this._Album.ID %>"  onclick="javascript: return confirmDelete();"><%=LanguageUtility.GetLanguageText("DELETE", Session)%></a></span></span>
        &nbsp;&nbsp;&nbsp;
        <%} %>
        <a title="<%=LanguageUtility.GetLanguageText("CLICK_RETURN", Session) %>" href="?action=view&g=<%=this.Request.QueryString["g"] %>&mnuid=<%=Request.QueryString["mnuid"] %>&time=<%=DateTime.Now.Ticks %>"><img src="resources/images/Back.png" alt="" /></a>
    </div>    
    <%if (this._Album != null) { %>
    <script type="text/javascript">
        YAHOO.util.Event.onContentReady("spLinkDelete", function () {
            var oSpLinkEdit = new YAHOO.widget.Button("spLinkEdit");
            var oSpLinkDelete = new YAHOO.widget.Button("spLinkDelete");
        });
    <%} %>
    </script>
</div>
<%if (this._Album != null) { %>
<table cellspacing="0" cellpadding="3" border="1" class="grid" id="tbTypeDetail">
    <tr class="odd">
        <td align="right" width="150px"><%=LanguageUtility.GetLanguageText("ALBUM_NAME", Session)%>:</td>
        <td class="b blue"><%=this._Album.AlbumName%></td>
    </tr>
    <tr class="even">
        <td align="right"><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%>:</td>
        <td> <%=this._Album.Active ? "<img src=\"resources/images/active.png\" />" : "<img src=\"resources/images/inactive.png\" />"%></td>
    </tr>
    <tr class="odd">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("PRESENTATIVE_IMAGE", Session)%>:
        </td>
        <td>
            <%if (this._Album.Image != null && this._Album.Image.Length > 0) { %>
            <a href="../<%=this._Album.ImagePath + this._Album.Image%>" target="_blank"><img class="mw100 mh100" src="../<%=this._Album.ImagePath + this._Album.Image%>" alt="" /></a>
            <%} else { %>
            <img class="mw100 mh100" src="../resources/images/noimage.jpg" alt="" />
            <%} %>
        </td>
    </tr>
    <tr class="even">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("DEFAULT_SIZE", Session)%>:</td>
        <td><%=this._Album.DefaultWidth %> x <%=this._Album.DefaultHeight %> pixels
        </td>
    </tr>
    <tr class="odd">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("MINI_SIZE", Session)%>:</td>
        <td><%=this._Album.MiniDefaultWidth %> x <%=this._Album.MiniDefaultHeight%> pixels
        </td>
    </tr>
</table>
<div class="tip" style="margin-top: 10px; height: 22px;">
	<div style=" width: 200px; clear: left; float: left; padding-top: 2px;">
        <h2 style="padding-top: 0px;"><%=LanguageUtility.GetLanguageText("IMAGE_LIST", Session)%></h2>
    </div>
    <div style="clear: right; float: right; text-align: right; width: 50%;">
        <span id="spLinkAddContent" class="yui-button yui-link-button yuibtn yuibtn-icon btnaddi"><span class="first-child"><a href="?action=addimage&g=<%=this.Request.QueryString["g"] %>&mnuid=<%=Request.QueryString["mnuid"] %>&albumid=<%=this._Album.ID %>&time=<%=DateTime.Now.Ticks %>"><%=LanguageUtility.GetLanguageText("ADD_NEW", Session)%></a></span></span>
    </div>
    <script type="text/javascript">
        YAHOO.util.Event.onContentReady("spLinkAddContent", function () {
                var ospLinkAddContent = new YAHOO.widget.Button("spLinkAddContent");
            });
    </script>
</div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
        <td align="left">
            <table border="1" cellpadding="0" cellspacing="0" class="grid" id="tbGrid">
                <tr>
                    <th width="42px">#</th>
                    <th><%=LanguageUtility.GetLanguageText("NAME", Session)%></th>
                    <th><%=LanguageUtility.GetLanguageText("IMAGE", Session)%></th>
                    <th><%=LanguageUtility.GetLanguageText("LINK", Session)%></th>
                    <th><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%></th>
                    <th width="42px"><%=LanguageUtility.GetLanguageText("EDIT", Session)%></th>
                </tr>
                <%if (this._ImageList != null) for (int i = 0; i < this._ImageList.Rows.Count; i++) 
                  {  
                      System.Data.DataRow row = this._ImageList.Rows[i];
                      int id = (int)row[CommonImage.ID__COLUMN_NAME];
                      %>
                <tr class="<%=(i%2==1?"even":"odd") %>">
                    <td align="center"><%=i + 1 %></td>
                    <td align="left"><b><%=row[CommonImage.IMAGENAME__COLUMN_NAME] %></b></td>
                    <td align="center"><a target="_blank" href="../<%=this._Album.ImagePath + row[CommonImage.IMAGEFILENAME__COLUMN_NAME].ToString() %>"><img src="../<%=this.GetMiniImage(this._Album.ImagePath, row[CommonImage.IMAGEFILENAME__COLUMN_NAME].ToString()) %>" alt="" style="max-width: 100px; max-height: 75px;" /></a></td>
                    <td align="left"><a target="_blank" href="<%=row[CommonImage.LINKURL__COLUMN_NAME] %>"><%=row[CommonImage.LINKURL__COLUMN_NAME] %></a></td>
                    <td align="center"><%=((int)row[CommonImage.ACTIVE__COLUMN_NAME] == 1 ? "<img src=\"resources/images/active_l.png\"" : "<img src=\"resources/images/inactive_l.png\"")%></td>
                    <td align="left">
                        <ul class="icon" style="width: 112px;">
                            <li><a title="<%=LanguageUtility.GetLanguageText("EDIT", Session)%>" href="?action=editimage&g=<%=this.Request.QueryString["g"] %>&mnuid=<%=Request.QueryString["mnuid"] %>&albumid=<%=this._Album.ID %>&id=<%=id %>&time=<%=DateTime.Now.Ticks %>" class="icon editbn">&nbsp</a></li>
                            <li><a title="<%=LanguageUtility.GetLanguageText("DELETE", Session)%>" href="?action=delimage&g=<%=this.Request.QueryString["g"] %>&mnuid=<%=Request.QueryString["mnuid"] %>&albumid=<%=this._Album.ID %>&id=<%=id %>&time=<%=DateTime.Now.Ticks %>" class="icon deletebn" onclick="javascript: return confirmDelete();">&nbsp</a></li>
                            <li><a title="<%=LanguageUtility.GetLanguageText("MOVE_UP", Session)%>" href="?action=moveupimage&g=<%=this.Request.QueryString["g"] %>&mnuid=<%=Request.QueryString["mnuid"] %>&albumid=<%=this._Album.ID %>&id=<%=id %>&time=<%=DateTime.Now.Ticks %>" class="icon ascbn">&nbsp</a></li>
                            <li><a title="<%=LanguageUtility.GetLanguageText("MOVE_DOWN", Session)%>" href="?action=movedownimage&g=<%=this.Request.QueryString["g"] %>&mnuid=<%=Request.QueryString["mnuid"] %>&albumid=<%=this._Album.ID %>&id=<%=id %>&time=<%=DateTime.Now.Ticks %>" class="icon descbn">&nbsp</a></li>
                        </ul>
                    </td>
                </tr>
                <%} %>
            </table>
        </td>
    </tr>
</table>
<%} %>
<script type="text/javascript">
    function confirmDelete() {
        var msg = '<%=LanguageUtility.GetLanguageText("CONFIRM_DELETE", Session).Replace(Environment.NewLine, "<br />")%>';
        return confirm(msg.replace(/<br \/>/gi, "\r\n").replace(/<br\/>/gi, "\r\n"));
    }
</script>